import request from '@/utils/request';

// 查询分类列表
export function listCategory(query) {
  return request({
    url: '/model/management/list',
    method: 'get',
    params: query
  })
}

// 查询部门列表（排除节点）
export function listCategoryExcludeChild(categoryId) {
  return request({
    url: '/model/management/list/exclude/' + categoryId,
    method: 'get'
  })
}

// 查询部门详细
export function getCategory(categoryId) {
  return request({
    url: '/model/management/' + categoryId,
    method: 'get'
  })
}

// 新增部门
export function addCategory(data) {
  return request({
    url: '/model/management',
    method: 'post',
    data: data
  })
}

// 修改部门
export function updatCategory(data) {
  return request({
    url: '/model/management',
    method: 'put',
    data: data
  })
}

// 删除部门
export function delCategory(categoryId) {
  return request({
    url: '/model/management/' + categoryId,
    method: 'delete'
  })
}
